package com.subfg.common.entity.call.request.refund;


import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "系统定义的退款数据")
@JsonInclude(value=JsonInclude.Include.NON_NULL)
public class ApplyRefundModel implements Serializable {
    @ApiModelProperty(value = "回调地址")
    private String webhook;
    @ApiModelProperty(value = "业主用户id")
    private String owerId;
    @ApiModelProperty(value = "需要退款的数据集")
    private List<RefundOrderModel> refundList;

    @ApiModelProperty(value = "请求时间")
    private Long requestTime;
    @ApiModelProperty(value = "接收三方回调时间, 以本地接收回调为准")
    private Long callBackTime;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(value = "退款订单详细数据")
    @JsonInclude(value=JsonInclude.Include.NON_NULL)
    public static class RefundOrderModel<T> implements Serializable {
        @ApiModelProperty(value = "退款订单号[合单订单号]")
        private String orderNo;
        @ApiModelProperty(value = "系统订单号")
        private String sysOrderNo;
        @ApiModelProperty(value = "渠道方订单号")
        private String channelNo;
        @ApiModelProperty(value = "退款单号")
        private String refundNo;
        @ApiModelProperty(value = "退款渠道")
        private String channel;
        @ApiModelProperty(value = "退款原价")
        private BigDecimal refundAmount;
        @ApiModelProperty(value = "退款原件需计算完")
        private BigDecimal computeRefundAmount;
        @ApiModelProperty(value = "实际退款金额")
        private BigDecimal refundFeeAmount;
        @ApiModelProperty(value = "退款状态 [-1: 退款失败 0: 退款中 1: 退款完成 2:申请重复退款]")
        private Integer refundStatus;
        @ApiModelProperty(value = "失败退款原因")
        private String exceptionExplain;
        @ApiModelProperty(value = "退款附加数据")
        private T attach;
    }
}